package com.example.service.impl;

import com.example.service.overtimeMonitoringService;


import com.example.pojo.overtimeMonitoringPojo;


import com.example.mapper.overtimeMonitoringMapp;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.beans.factory.annotation.Autowired;


import org.springframework.stereotype.Service;


import java.time.LocalDateTime;
import java.util.List;

@Service
public class overtimeMonitoringImpl implements overtimeMonitoringService{


@Autowired
private overtimeMonitoringMapp overtimeMonitoringMapp;

    @Override
    public List<overtimeMonitoringPojo> queryAll(){

        List<overtimeMonitoringPojo> overtimeMonitoringPojoList = overtimeMonitoringMapp.queryAll();

        return overtimeMonitoringPojoList;



}
    @Override
    public List<overtimeMonitoringPojo> queryByPage(int offset, int pageSize) {
        return overtimeMonitoringMapp.queryByPage(offset, pageSize);
    }

    @Override
    public int queryTotalCount() {
        return overtimeMonitoringMapp.queryTotalCount();
    }

   @Override
    public void insertOne(overtimeMonitoringPojo overtimeMonitoringPojo){

       overtimeMonitoringPojo.setCreate_time(LocalDateTime.now());
       overtimeMonitoringPojo.setUpdate_time(LocalDateTime.now());
       overtimeMonitoringMapp.insertOne(overtimeMonitoringPojo);
    }

    @Override
    public void editOvertimeMonitoring(overtimeMonitoringPojo overtimeMonitoringPojo){

        overtimeMonitoringPojo.setUpdate_time(LocalDateTime.now());
        // 调用 Mapper 层的方法更新数据
        overtimeMonitoringMapp.update(overtimeMonitoringPojo); // 确保 clerkNameMapp 中有 updateClerkName 方法


    }







}
